import { Component } from 'react';

class TodoItem extends Component {
    constructor(props){
        super(props);
        this.handleDelItem = this.handleDelItem.bind(this);
    }

    handleDelItem(){
        const { index } = this.props
        this.props.delete(index)
    }

    render() {
        let { content } = this.props;
        return <div onClick={this.handleDelItem}>{content}</div>
        
    }
}

export default TodoItem;